package com.coincalf.feign;

import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.coincalf.dto.TradeAreaDTO;
import com.coincalf.feign.hystrix.TradingAreaServiceClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.util.List;

/**
 * @author qiang
 */
@FeignClient(value = "coincalf-service", fallback = TradingAreaServiceClientFallback.class)
public interface TradingAreaServiceClient {

    @Cached(expire = 120, cacheType = CacheType.LOCAL)
    @RequestMapping(value = "/trading_area/list", method = RequestMethod.GET)
    List<TradeAreaDTO> tradingAreaList();

    @Cached(expire = 120, cacheType = CacheType.LOCAL)
    @RequestMapping(value = "/forex_area/list", method = RequestMethod.GET)
    List<TradeAreaDTO> forexAreaList();
}